package com.cj.rabbitmq.service;

import com.cj.common.response.Result;
import com.cj.rabbitmq.service.impl.OrderFeignFallbackFactory;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @Author cheng jun
 * @Description:
 * @Date 2021/5/25 18:03
 */
@FeignClient(value = "boot-order-service", fallbackFactory = OrderFeignFallbackFactory.class)
public interface OrderFeignService {

    @RequestMapping(value = "/order/file", method = RequestMethod.POST)
    Result file(Map<String, Object> map);

    @RequestMapping(value = "/file/downLoad", method = RequestMethod.POST, consumes = MediaType.APPLICATION_PROBLEM_JSON_VALUE)
    Response download(Map<String, Object> map, @RequestParam(value = "response") HttpServletResponse response);

}
